#include <bits/stdc++.h>
using namespace std;
int main() {
  string p, t;
  cin >> p >> t;
  /*   int k = t.find(p);
    if (k != t.npos) // 留意这里的npos
      cout << "Yes";
    else
      cout << "No";
   */
  int n = p.size(), m = t.size();
  int i = 0, j = 0;
  while (i < n && j < m) {
    if (p[i] == t[j]) {
      i++;
      j++;
    }
    else
      j++;
  }
  if (i == n)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}